package com.test.dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class DaoToolImpl extends HibernateDaoSupport implements DaoTool {

	public List getStartTend(int startPage, int pageCount) {


		return this.getSession().createQuery("from User").setFirstResult(
				startPage * pageCount).setMaxResults(pageCount).list();

	}

	public long getTotalRecord(Class c) {

		return (Long) this.getSession().createQuery(
				"select count(*) from " + c.getSimpleName()).uniqueResult();

	}

}
